<script type="text/javascript"> //Scroll Fixed
	var $ = jQuery.noConflict();
	(function($){
		$.fn.scrollFixed = function(params){
			params = $.extend( {appearAfterDiv: 0, hideBeforeDiv: 0}, params);
			var element = $(this);
		 
			if(params.appearAfterDiv)
				var distanceTop = element.offset().top + $(params.appearAfterDiv).outerHeight(true) + element.outerHeight(true);
			else
				var distanceTop = element.offset().top;
		 
			if(params.hideBeforeDiv)
				var bottom = $(params.hideBeforeDiv).offset().top - element.outerHeight(true) - 10;
			else
				var bottom = 200000;				
		 
			$(window).scroll(function(){	
				if( $(window).scrollTop() > distanceTop && $(window).scrollTop() < bottom ){ 		
		            element.css({'position':'fixed','z-index':'1','width':'100%', 'top':'0px'});
		            $('.show-on-scroll').css({'display':'inline-block'});
		            $('.hide-on-scroll').css({'display':'none'});
					$('.scroll-fixed').addClass('scrolling');
				}else{
		    		element.css({'position':'static'});
		    		$('.show-on-scroll').css({'display':'none'});
		    		$('.hide-on-scroll').css({'display':'inline-block'});
					$('.scroll-fixed').removeClass('scrolling');
				}	
			});			  
		};
		
		$.fn.staticAd = function(params){
			params = $.extend( {appearAfterDiv: 0, hideBeforeDiv: 0}, params);
			var element = $(this);
		 
			if(params.appearAfterDiv)
				var distanceTop = element.offset().top + $(params.appearAfterDiv).outerHeight(true) + element.outerHeight(true);
			else
				var distanceTop = element.offset().top;
		 
			if(params.hideBeforeDiv)
				var bottom = $(params.hideBeforeDiv).offset().top - element.outerHeight(true) - 10;
			else
				var bottom = 200000;				
		 
			$(window).scroll(function(){	
				if( $(window).scrollTop() > distanceTop && $(window).scrollTop() < bottom ){ 		
		            element.css({'position':'fixed','z-index':'1','width':'100%', 'top':'60px'});
				}else{
		    		element.css({'position':'static'});
				}	
			});			  
		};
	})(jQuery);
	
	$(document).ready( function(){
	    $(".scroll-fixed").scrollFixed();
		$("#staticAd").staticAd();
	});

	$(document).ready(function() {		    
	    $('a[href=#top]').click(function(){
	        $('html, body').animate({scrollTop:0}, 'slow');
	        return false;
	    });
	});
</script>